package com.jdiv.samples.zelda.applet;

import com.jdiv.JProcess;

public class Enemigo extends JProcess {
private int
		DIRECCION=1;

	public Enemigo() {
		super();
		file=Main.fpg_enemigo;
		graph=189;
		x=145;
		y=110;
		
	}
	public void begin(){}
	public void loop(){
	
		
	     if(x==145){
	      DIRECCION=1;
	      graph=189;
		}
	     if(x==260){
	      DIRECCION=0;
	      graph=195;
		}
	     if(DIRECCION==1){
	      x++;
	       if(graph==194)    graph=189;
	       else    graph++;
	     }
	     
	      if(DIRECCION==0){
	      x--;
	      if(graph==200)  graph=195;
	      	else    graph++;
	      }
	      
	      if (collision("Link")) {
	    	  for (graph=150;graph<=161;graph++){
	          frame();
	    	  }
	    	  graph=189;
	    	  
	      }
	
	}

}
